#include "../Client/RpcClient.hpp"

int main()
{
    RpcClient::RpcClient Client(false,"127.0.0.1",8080);
    // 构建一条rpc请求对象
    Json::Value paras;
    paras["nums1"] = 6;
    paras["nums2"] = 2;

    // // 构建一条主题请求信息的正文部分
    // auto TopicRequest = Message::BuildMessage::build<Message::TopicRequest>();
    // TopicRequest->SetMtype(Rs_RqType::TOPIC_Req);
    // TopicRequest->SetUuid(UUID::uuid());
    // TopicRequest->SetTopic("Music");
    // TopicRequest->SetTopOper(TopicOperType::Topic_SubScribe);

    Json::Value paras1,result;
    paras1["nums1"] = 60;
    paras1["nums2"] = 20;
    std::future<Abstract::BaseMessage::MesaPtr>  RpcFuture;
    std::string uuid;
    while (true) // 主线程负责发送消息
    {
        Client.call("Add",paras1,result);
        std::cout<<result["Res"].asInt()<<std::endl;
        sleep(4);
    }
}